﻿@model Project.Database.AdCampain
@{
    ViewBag.Title = "ShowCampaign";
}
<h2>
    ShowCampaign</h2>
<fieldset>
    <legend>AdCampain</legend>
    <div class="display-label">
        AdvertiserID</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.AdvertiserID)
    </div>
    <div class="display-label">
        Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Name)
    </div>
    <div class="display-label">
        StartDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.StartDate)
    </div>
    <div class="display-label">
        EndDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EndDate)
    </div>
    <div class="display-label">
        RemainingBalance</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.RemainingBalance)
    </div>
    <div class="display-label">
        DateCreated</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.DateCreated)
    </div>
</fieldset>
<h2>
    Adverts</h2>
<ul>
    @{
        int i = 0;    
        foreach (Project.Database.Advert advert in ViewBag.Adverts)
        { 
            <li>Name: @advert.Name</li>
            <li>Path: @advert.URL</li>
            <li>Brand: @advert.Advertiser.BrandName</li>
            <li>
                
                @if (Project.Implementations.Utils.GetAdvertType(advert) > 0)
                {
                    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="200" height="100" ><param name="movie" value="@Url.Content(advert.URL)" /><embed src="@Url.Content(advert.URL)" width="200" height="100" name="horse" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>
                }
                else
                {
                    <img src= "@Url.Content(advert.URL)" alt="Advert Image" width="200" height="100" />;
                }
            </li>
                foreach (Project.Database.Blog blog in advert.Blogs)
                {
                 <li>Is on blog: @blog.Name</li>
                }
        }
    }
</ul>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ID })
    @Html.ActionLink("Add an advert", "AddAdvert", "Advert", new { id = Model.ID }, null)
    @Html.ActionLink("Back to List", "Index")
</p>
